LinkRef

LinkRef

What is a LinkRef?

Can it be cast or converted to a Link?
Doorsbert - Thu Mar 12 19:52:40 EDT 2009

Re: LinkRef
ePiallat - Fri Mar 13 04:29:28 EDT 2009

> What is a LinkRef?

A LinkRef is a "reference to a Link".

A LinkRef handles al the data stored at the target side of a Link: Link themselves are stored in the source Object.

To access a "Link", you need to first load the Formal Module containing the source Object.

LinkRef allows accessing a minimum set of information about incoming Links without loading the sources:
  • corresponding Link Module
  • source module's name
  • source object's absolute number

LinkRefs are used mainly for opening source modules before cycling through actual Links.

> Can it be cast or converted to a Link?

No.
Nothing can be converted to a Link.
Valid Link handlers are obtained only through a for..do loop or through the Link creation operator ->.
Single exception to this is the Link link(Trigger t) perm that returns the Link that fires the trigger.

It is possible to access an existing Link by "re-creating" it, but what's the point using LinkRef if source is in edit mode ?

– Éric

Re: LinkRef
Doorsbert - Sun Mar 15 01:37:28 EDT 2009

ePiallat - Fri Mar 13 04:29:28 EDT 2009
> What is a LinkRef?

A LinkRef is a "reference to a Link".

A LinkRef handles al the data stored at the target side of a Link: Link themselves are stored in the source Object.

To access a "Link", you need to first load the Formal Module containing the source Object.

LinkRef allows accessing a minimum set of information about incoming Links without loading the sources:

  • corresponding Link Module
  • source module's name
  • source object's absolute number

LinkRefs are used mainly for opening source modules before cycling through actual Links.

> Can it be cast or converted to a Link?

No.
Nothing can be converted to a Link.
Valid Link handlers are obtained only through a for..do loop or through the Link creation operator ->.
Single exception to this is the Link link(Trigger t) perm that returns the Link that fires the trigger.

It is possible to access an existing Link by "re-creating" it, but what's the point using LinkRef if source is in edit mode ?

– Éric

Thanks for the reply, much appreciated!

> A LinkRef is a "reference to a Link".

I am not a computer scientist, but I have used a number of languages, and from that experience I would argue that calling something a "reference" normally means that you have access to the item it refers to via that reference. Since a LinkRef does not give you access to a Link, but rather, "a minimum set of information about incoming links" it would be beneficial for the DOORS group to give it a more appropriate name, or at a minimum, a meaningful alias (e.g. IncomingLinkInfo). It also would be greatly appreciated if the DOORS organization decided to define and document each of their types that begin with a capital letter.

Re: LinkRef
ePiallat - Mon Mar 16 12:51:27 EDT 2009

Doorsbert - Sun Mar 15 01:37:28 EDT 2009
Thanks for the reply, much appreciated!

> A LinkRef is a "reference to a Link".

I am not a computer scientist, but I have used a number of languages, and from that experience I would argue that calling something a "reference" normally means that you have access to the item it refers to via that reference. Since a LinkRef does not give you access to a Link, but rather, "a minimum set of information about incoming links" it would be beneficial for the DOORS group to give it a more appropriate name, or at a minimum, a meaningful alias (e.g. IncomingLinkInfo). It also would be greatly appreciated if the DOORS organization decided to define and document each of their types that begin with a capital letter.

Completely agreed, thus the "quotation marks": this definition comes from the DXL reference manual, even if I don't approve it.

But, as my lawyer says:
"I don't write the rules. I just twist them to my own purpose."